# !/usr/bin/env python
# coding: utf-8
# @Time   : 2022/11/24 23:19
# @Author : 梁灿

import os, sys
sys.path.append((os.path.abspath(os.path.join(os.path.dirname(__file__), '../../'))))

from page.basepage import BasePage
from common.readelement import Element


login = Element('login')  # 获取login.yml
print(login['账号'])


class LoginPage(BasePage):
    """登录"""
    def input_username(self, content):
        self.input_text(login['账号'], content)

    def input_password(self, content):
        self.input_text(login['密码'], content)

    def in_login(self):
        self.is_click(login['登录'])

    def assertion(self):
        text = self.element_text(login['断言'])
        return text

    def out_login(self):
        self.is_click(login['点击退出'])
        self.is_click(login['退出登录'])
